import { menuList } from "../../../request/api";
const state = {
    menulist: []
}
const getters = {
    getMenu(state) {
        return state.menulist
    }
}
const mutations = {
    REQ_LIST(state,payload){
        state.menulist=payload
    }
}
const actions = {
    getMenuAction({commit}) {
        menuList().then((res) => {
            console.log(res, "菜单列表");
            if(res.code==200){
               commit('REQ_LIST',res.list)
            }
        });

    }
}


export default {
    state,
    getters,
    mutations,
    actions,
    //开启命名空间
    namespaced: true
}